package wrapper;
import java.util.Scanner;
import java.util.Random;
public class Abc {
    public static void main(String[] args) {
        String line="qwertyuiopasdfghjklzxcvbnm123456789QWERTYUIOPASDFGHJKLZXCVBNM";
        Random rand = new Random();
        String code="";
        for(int i=0;i<4;i++){
            int index=rand.nextInt(line.length());
            char c=line.charAt(index);
            code+=c;}
        System.out.println("验证码："+code);
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入上述验证码：");
        String input=scanner.nextLine();
        if (code.equalsIgnoreCase(input)){
            System.out.println("通过");
        }else {
            System.out.println("失败");
        }
    }
}
